import { createRouter, createWebHistory } from 'vue-router'

const routes = [
    { 
        //首页
        path: "/",
        name: "home",
        component: () => import("@/views/home/home.vue"),
        meta: {
            id: '1',
            name: '首页',
            icon: 'House'
        }
    },
    {
        //登录
        path: "/login",
        name: "login",
        component: () => import("@/views/login/login.vue"),
        meta: {
            id: '2',
            name: '登录',
            icon: 'User'
        }
    },
    {
        //系统管理
        path: "/system",
        name: "system",
        component: () => import("@/views/system/index.vue"),
        meta: {
            id: '3',
            name: '系统管理',
            icon: 'Setting'
        },
        children: [
            {
                path: "user",
                name: "user",
                component: () => import("@/views/system/user.vue"),
                meta: {
                    id: '3-1',
                    name: '用户管理',
                    icon: 'User'
                }
            },
            {
                path: "role",
                name: "role",
                component: () => import("@/views/system/role.vue"),
                meta: {
                    id: '3-2',
                    name: '角色管理',
                    icon: 'UserFilled'
                }
            }
        ]
    }
]

const router = createRouter({
    routes,
    history: createWebHistory()
})

export default router